package com.yc.cloud.openai.portal.enums;


import lombok.Getter;

import java.util.Objects;

@Getter
public enum SpeechToTextProvider {
    //科大讯飞
    XUN_FEI("1", "XUN_FEI"),
    //微软云
    AZURE("2", " AZURE");


    private final String key;
    private final String value;

    SpeechToTextProvider(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static SpeechToTextProvider fromKey(String key) {
        for (SpeechToTextProvider provider : SpeechToTextProvider.values()) {
            if (Objects.equals(provider.getKey(), key)) {
                return provider;
            }
        }
        throw new IllegalArgumentException("Unknown provider key: " + key);
    }
}

